﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ggdll.GGMessages.Outgoing
{
    class GGMessageNewStatus
    {

        private static int message_type=(int)GGMessageType.GG_NEW_STATUS80;
        private int message_size;
        public int status;		
	    public int flags;		
	    public string description="";	

        public byte[] getBytes()
        {
            message_size = 12 + description.Length;
            byte[] response = new byte[message_size + 8];
            System.Buffer.BlockCopy(BitConverter.GetBytes(message_type), 0, response, 0, 4); 
            System.Buffer.BlockCopy(BitConverter.GetBytes(message_size), 0, response, 4, 4); 

            System.Buffer.BlockCopy(BitConverter.GetBytes(status), 0, response, 8, 4); 

            System.Buffer.BlockCopy(BitConverter.GetBytes(flags), 0, response, 12, 4); 

            System.Buffer.BlockCopy(BitConverter.GetBytes(description.Length), 0, response, 16, 4);
            System.Buffer.BlockCopy(StaticVars.enc.GetBytes(description), 0, response, 20, description.Length); 


            return response;
        }
    }
}
